import request from '@/utils/request'

export default {
  market(dateStart, dateEnd) {
    return request({
      url: '/corp-marketstat',
      method: 'get',
      params: {
        statisticsBegin: dateStart,
        statisticsEnd: dateEnd
      }
    }).then(response => response.data)
  },
  rangeData(dateStart, dateEnd) {
    return request({
      url: '/corp-stat/range-data',
      method: 'get',
      params: {
        startDate: dateStart,
        endDate: dateEnd
      }
    }).then(response => response.data)
  },
  renderReports(dateType) {
    return request({
      url: '/corp-stat/total-data',
      method: 'get',
      params: {
        dateType: dateType
      }
    }).then(response => response.data)
  },
  updateStep(id, step) {
    return request({
      url: `/init-setting/${id}/${step}`,
      method: 'put'
    }).then(response => response.data)
  },
  initStarted(userId) {
    return request({
      url: `/init-setting/${userId}`,
      method: 'put'
    }).then(response => response.data)
  },
  getInitSetting(userId) {
    return request({
      url: `/init-setting/${userId}`,
      method: 'get'
    }).then(response => response.data)
  }

}
